/**
 * Created by xw2sy on 2017-05-03.
 */
$(function () {
    //进入页面自动读一次卡
    readCardIdInOneFrame(AppCardRead.onCardRead);

    $("#jsBtnOpenCard").click(function () {
    	var a = $("#txtCardId").val();
    	var b = $("label :radio:checked").parent().text();
    	$("#ccid").html(a);
    	$("#cadd").html(b);
    	util.el.confirm("#comfirOpen",function () {
    		util.request.post("/card/openCard.json",util.el.data("form"),function (data) {
    			//打印    			  
                doLottPrintInOneFrame(eval(template("templatePrint",data)));
                
                if($("#jsConfirmDialog:visible").length != 0){
              		$("#jsConfirmDialog").modal('hide');
              	}
    			util.el.confirm("#showOpenMsg",function () {
    				location.href=appRoot+"index.html";
    			});
    		});
    	});
    });
});